package com.wen.system.shiro.authc.context;

import org.apache.shiro.authc.AuthenticationInfo;

/**
 * 身份验证信息上下文
 * <p>
 *
 * @author devin <devinlive@163.com>
 * @version 1.0
 * @since 2023/08/22 15:10
 */
public class AuthenticationContextHolder {

    private static final ThreadLocal<AuthenticationInfo> contextHolder = new ThreadLocal<>();

    public static AuthenticationInfo getContext()
    {
        return contextHolder.get();
    }

    public static void setContext(AuthenticationInfo context)
    {
        contextHolder.set(context);
    }

    public static void clearContext()
    {
        contextHolder.remove();
    }
}
